load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
load("@fbcode_macros//build_defs/lib:re_test_utils.bzl", "re_test_utils")

oncall("fbcode_entropy_wardens_folly")

cpp_unittest(
    name = "ConnectionManagerTest",
    srcs = ["ConnectionManagerTest.cpp"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        "//folly:network_address",
        "//folly/portability:gflags",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//wangle/acceptor:managed",
    ],
)

cpp_unittest(
    name = "EvbHandshakeHelperTest",
    srcs = ["EvbHandshakeHelperTest.cpp"],
    headers = ["AcceptorHelperMocks.h"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        "//folly/futures:barrier",
        "//folly/io/async:scoped_event_base_thread",
        "//folly/io/async/test:mocks",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
        "//wangle/acceptor:acceptor",
        "//wangle/acceptor:evb_handshake_helper",
    ],
)

cpp_unittest(
    name = "LoadShedConfigurationTest",
    srcs = ["LoadShedConfigurationTest.cpp"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        "//folly/portability:gtest",
        "//wangle/acceptor:load_shed_configuration",
    ],
)

cpp_unittest(
    name = "AcceptorTest",
    srcs = ["AcceptorTest.cpp"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    supports_static_listing = False,
    deps = [
        "//folly/io/async:async_base",
        "//folly/io/async/test:async_ssl_socket_test_lib",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//folly/testing:test_util",
        "//wangle/acceptor:accept_observer",
        "//wangle/acceptor:acceptor",
    ],
    external_deps = [
        "glog",
    ],
)

cpp_unittest(
    name = "PeekingAcceptorHandshakeHelperTest",
    srcs = ["PeekingAcceptorHandshakeHelperTest.cpp"],
    headers = ["AcceptorHelperMocks.h"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        "//folly/io/async/test:mocks",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//wangle/acceptor:acceptor",
    ],
)

cpp_unittest(
    name = "SecurityProtocolContextManagerTest",
    srcs = ["SecurityProtocolContextManagerTest.cpp"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//wangle/acceptor:acceptor",
    ],
)

cpp_unittest(
    name = "SocketPeekerTest",
    srcs = ["SocketPeekerTest.cpp"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        "//folly/io/async/test:mocks",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//wangle/acceptor:socket_peeker",
    ],
)

cpp_unittest(
    name = "SharedSSLContextManagerTest",
    srcs = ["SharedSSLContextManagerTest.cpp"],
    remote_execution = re_test_utils.remote_execution_linux_default(),
    deps = [
        "//folly:file_util",
        "//folly/io/async:async_base",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//folly/testing:test_util",
        "//wangle/acceptor:fizz_config_util",
        "//wangle/acceptor:shared_ssl_context_manager",
    ],
)
